<?php

namespace Admin\Assist\Controllers;

/**
 * Created by PhpStorm.
 * User: Lvyj
 * Date: 2017/6/21 0021
 * Time: 9:53
 */
use Helpers\Assets;
use Helpers\Main;
use Helpers\Template;

class ReportsController extends ControllerBase
{

    public function indexAction()
    {
        $this->view->pick("report/index");
        Assets::easyUI('js/report.js');
        Template::exists('report', 'list') or die(Main::showMessageModal('配置文件不存在，请先创建！', 109106002));
        $listSearchArr = array();
        //$listSearchArr[] = array('type' => 'text', 'id' => 'List_Search', 'label' => ' 搜索： ');
        $listSearchArr[] = ['type' => 'select', 'id' => 'list_item' , 'style' => 'width:110px;', 'data' => [
            '1'            => '网络检测',
            '2'              => '日活检测',
            '3'           => '流量检测',
        ]];
        $listSearchArr[] = ['type' => 'select', 'id' => 'search_item', 'style' => 'width:110px;', 'data' => [
            ''                      => '无',
            'deviceId'            => '设备Id',
            'userId'              => '用户Id',
        ]];
        $listSearchArr[] = ['type' => 'text', 'id' => 'search_vague'];

        $this->view->setVars(array(
            'List' => Template::createList('List', 'report', [
                'searchToolbar' => Template::createSearchToolBar($listSearchArr, true)
            ])
        ));
    }

}